package edu.bbu.cshu.wmpc.dao;

import java.util.ArrayList;

import edu.bbu.cshu.wmpc.core.FileTypes;
import edu.bbu.cshu.wmpc.core.SourceCodeWmpc;
/**
 * <ul>
 * <li><b><i>CodeDAO</i></b></li>
 * <li style="list-style: none;"></li>
 * <li style="list-style: none;">
 * Interface to be implemented by any concrete data access object class. Specifies function needed to communicate with the database. 
 * 
 * @author WMPC team
 * </li>
 * </ul>
 */ 
public interface CodeDAO {
	/**
	 * <ul style="margin-top: 24px;">
	 * <li><b><i>insertFile</i></b></li>
	 * <li style="list-style: none;"></li>
	 * <li style="list-style: none;">
	 * <p style="margin-left: 7px;">{@code public void insertFile(}{@link String} {@code URL) throws} {@link Exception}</p>
	 * <br>	
	 * Inserts into the database the contents of the file specified in the {@code URL}. 
	 * 
	 * @param URL - {@code String} describing the location of the file
	 * @throws    if any error occurred while trying to perform the insert  
	 * </li>
	 * </ul>
	 */
	public void insertFile(String URL) throws Exception;
	/**
	 * <ul style="margin-top: 24px;">
	 * <li><b><i>getFileById</i></b></li>
	 * <li style="list-style: none;"></li>
	 * <li style="list-style: none;">
	 * <p style="margin-left: 7px;">{@code public} {@link ArrayList}<{@link String}> {@code getFileById(int id) throws} {@link Exception}</p>
	 * <br>	
	 * Returns the content of a file specified by its {@code id}. 
	 * 
	 * @param id - the {@code id} of the file 
	 * @return   an {@code ArrayList<String>} with the content of the file
	 * @throws   if any error occurred while trying to return the file contents 
	 * </li>
	 * </ul>
	 */
	public ArrayList<String> getFileById(int id) throws Exception;
	/**
	 * <ul style="margin-top: 24px;">
	 * <li><b><i>getFileByName</i></b></li>
	 * <li style="list-style: none;"></li>
	 * <li style="list-style: none;">
	 * <p style="margin-left: 7px;">{@code public} {@link ArrayList}<{@link String}> {@code getFileById(}{@link String} {@code name) throws} {@link Exception}</p>
	 * <br>	
	 * Returns the content of a file specified by its {@code name}.  
	 * 
	 * @param name - the {@code name} of the file
	 * @return	   an {@code ArrayList<String>} with the content of the file
	 * @throws     if any error occurred while trying to return the file contents
	 * </li>
	 * </ul>
	 */
	public ArrayList<String> getFileByName(String name) throws Exception;
	/**
	 * <ul style="margin-top: 24px;">
	 * <li><b><i>getAllFileContents</i></b></li>
	 * <li style="list-style: none;"></li>
	 * <li style="list-style: none;">
	 * <p style="margin-left: 7px;">{@code public} {@link SourceCodeWmpc} {@code getAllFileContents(}{@link String} {@code group,} {@link FileTypes} {@code type) throws} {@link Exception}</p>
	 * <br>	
	 * Returns the contents of multiple files, specified by the {@code group}, in a single {@code SourceCodeWmpc Object}. The {@code type} of the {@code SourceCodeWmpc} is also specified.  
	 * 
	 * @param group - {@code String} with the name of the file group
	 * @param type	- {@code FileTypes} specifying the type of the {@code SourceCodeWmpc}
	 * @return		{@code SourceCodeWmpc} containing multiple file contents
	 * @throws		if any error occurred while trying to return the file contents
	 * </li>
	 * </ul>
	 */
	public SourceCodeWmpc getAllFileContents(String group, FileTypes type) throws Exception;
    /**
	 * <ul style="margin-top: 24px;">
	 * <li><b><i>getAllFileInfos</i></b></li>
	 * <li style="list-style: none;"></li>
	 * <li style="list-style: none;">
	 * <p style="margin-left: 7px;">{@code public} {@link ArrayList}<{@link String}> {@code getAllFileInfos(}{@link FileTypes} {@code type) throws} {@link Exception}</p>
	 * <br>	
	 * Returns the group names of files which {@code type} was been specified. Files are being grouped according to the assignment {@code id} and student {@code id}.     
	 * 
	 * @param type - {@code type} of file
	 * @return     {@code ArrayList<String>} containing the file group names
	 * @throws	   if any error occurred while trying to return information about the file
	 * </li>
	 * </ul>
	 */
	public ArrayList<String> getAllFileInfos(FileTypes type) throws Exception;
}